import request from "@/utils/http";
/**
 * 获取详细地址
 */
export const getAddressAPI = () => {
    return request({
      url: "/member/address",
    });
  };

/**
 * 添加收货地址
 */
export const addAddressAPI = (data) => {
  return request({
    url: "/member/address",
    method: "post",
    data,
  });
};

/**
 * 根据id获取地址详情 
 */
export const getAddressDetailAPI = (id) => {
  return request({
    url: `/member/address/${id}`
  });
};

/**
 * 更新收货地址
 */
export const updateAddressAPI = (id, data) => {
  return request({
    url: `/member/address/${id}`,
    method: "put",
    data,
  });
};

/**
 * 删除收货地址
 */
export const delAddressAPI = (id) => {
  return request({
    url: `/member/address/${id}`,
    method: "delete",
  });
};